package com.gao.security.verificationcode.code;

import com.gao.security.verificationcode.common.RequestPathType;
import com.gao.security.verificationcode.entity.VerificationCode;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * <p></p>
 *
 * @author GaoShuangWen
 * @since 2019-07-31 15:01
 */
public interface VerificationCodeGenerationStrategy {

    /**
     * 创造验证码
     * @return
     */
    String createCode();

    /**
     * 传输验证码
     * @param request
     * @param response
     * @param code 验证码
     */
    void sendCode(HttpServletRequest request, HttpServletResponse response,VerificationCode code) throws IOException;


    VerificationCode check(HttpServletRequest request);


    /**
     * 验证码请求发送 类型    如 /img/code , /sms/code 这个img，sms、img就代表这个意思
     * @return
     */
    RequestPathType requestPathType();

}
